package com.hrt.common.systemmanager.systemsetting.dict.type;

import com.btcode.db.fieldtype.FieldType;
import com.btcode.orm.model.BaseModel;
import com.btcode.orm.model.Field;
import com.btcode.orm.model.IField;
import java.util.Date;

@SuppressWarnings("unchecked")
public class BcDictTypeModel extends BaseModel {

    private static final long serialVersionUID = 1L;


    private static String tableName = " C_BC_DICT_TYPE";


    public static IField id = new Field(BcDictTypeModel.class, "ID", FieldType.String, true);

    public static IField code = new Field(BcDictTypeModel.class, "CODE", FieldType.String, false,
                                          true, true);

    public static IField name = new Field(BcDictTypeModel.class, "NAME", FieldType.String, false);

    public static IField createtime = new Field(BcDictTypeModel.class, "CREATETIME",
                                                FieldType.DateTime, false);

    public static IField updatetime = new Field(BcDictTypeModel.class, "UPDATETIME",
                                                FieldType.DateTime, false);

    public static IField createBy = new Field(BcDictTypeModel.class, "CREATE_BY", FieldType.String,
                                              false);

    public static IField updateBy = new Field(BcDictTypeModel.class, "UPDATE_BY", FieldType.String,
                                              false);

    public void setId(String value) {
        setFieldValue(id.getFieldName(), value);
    }

    public String getId() {
        Object value = getFieldValue(BcDictTypeModel.id.getFieldName());
        String result = getValueConver().converToString(value);
        return result;
    }

    public void setCode(String value) {
        setFieldValue(code.getFieldName(), value);
    }

    public String getCode() {
        Object value = getFieldValue(BcDictTypeModel.code.getFieldName());
        String result = getValueConver().converToString(value);
        return result;
    }

    public void setName(String value) {
        setFieldValue(name.getFieldName(), value);
    }

    public String getName() {
        Object value = getFieldValue(BcDictTypeModel.name.getFieldName());
        String result = getValueConver().converToString(value);
        return result;
    }

    public void setCreatetime(Date value) {
        setFieldValue(createtime.getFieldName(), value);
    }

    public Date getCreatetime() {
        Object value = getFieldValue(BcDictTypeModel.createtime.getFieldName());
        Date result = getValueConver().converToDate(value);
        return result;
    }

    public void setUpdatetime(Date value) {
        setFieldValue(updatetime.getFieldName(), value);
    }

    public Date getUpdatetime() {
        Object value = getFieldValue(BcDictTypeModel.updatetime.getFieldName());
        Date result = getValueConver().converToDate(value);
        return result;
    }

    public void setCreateBy(String value) {
        setFieldValue(createBy.getFieldName(), value);
    }

    public String getCreateBy() {
        Object value = getFieldValue(BcDictTypeModel.createBy.getFieldName());
        String result = getValueConver().converToString(value);
        return result;
    }

    public void setUpdateBy(String value) {
        setFieldValue(updateBy.getFieldName(), value);
    }

    public String getUpdateBy() {
        Object value = getFieldValue(BcDictTypeModel.updateBy.getFieldName());
        String result = getValueConver().converToString(value);
        return result;
    }


    public String getTableName() {
        return tableName;
    }


    public boolean isNeedCache() {
        return true;
    }

}
